feat(sdk-coin-eth): add registerWithCoinMap for dynamic token registration#8589
Merged
manas-at-bitgo merged 1 commit intomasterfrom Apr 28, 2026
Merged
feat(sdk-coin-eth): add registerWithCoinMap for dynamic token registration#8589manas-at-bitgo merged 1 commit intomasterfrom
manas-at-bitgo merged 1 commit intomasterfrom
Conversation
9d9b444 to
e6fac36
Compare
pranavjain97
requested changes
Apr 22, 2026
Contributor
pranavjain97
left a comment
There was a problem hiding this comment.
the approach works but creates duplication that will drift. registerWithCoinMap copies the 4 base coin + ERC721 registrations from register(), and registerWithBaseCoin on BitGoBase is a public interface change for what's really an internal concern. simpler: have registerWithCoinMap call register(sdk) internally, then just add the dynamic token part with GlobalCoinFactory.registerToken() directly. no interface change needed.
also, no tests added for registerWithBaseCoin or the updated registerWithCoinMap.
e6fac36 to
25cc4fe
Compare
f1e5ea4 to
c2a6e6d
Compare
Contributor
Author
|
c2a6e6d to
87e4d9e
Compare
e03258b to
dd521b8
Compare
veetragjain
previously approved these changes
Apr 24, 2026
veetragjain
reviewed
Apr 24, 2026
veetragjain
reviewed
Apr 24, 2026
pranavjain97
requested changes
Apr 27, 2026
Contributor
pranavjain97
left a comment
There was a problem hiding this comment.
duplicate token registration will throw, and constructors are created twice per token
2313395 to
d28381a
Compare
d28381a to
0c017ca
Compare
…ation TICKET: CSHLD-24 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0c017ca to
ac15c77
Compare
veetragjain
approved these changes
Apr 28, 2026
pranavjain97
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
registerWithCoinMapinsdk-coin-ethas a drop-in replacement forregister()that supports dynamic ERC20 token registration from a consumer-providedCoinMapregister(sdk)internally for hardcoded base coins and tokens, then registers dynamic ERC20 tokens and adds them to the global coin map viaGlobalCoinFactory.registerToken()BitGoBaseorBitGoAPIMotivation
Enables dynamic token onboarding: consumers build a
CoinMapfrom AMS (which drifts ahead of what's baked into@bitgo/statics) and pass it toregisterWithCoinMap. New tokens become available viabitgo.coin()without an SDK version bump.TICKET: CSHLD-24
Test plan
register()registers base ETH coins + ERC20/ERC721 constructorsregisterWithCoinMap()delegates toregister()then adds dynamic tokens to the global coin mapregisterWithCoinMap()registers constructors by both type name and contract addressregisterTokencallsnpx mocha --require tsx modules/sdk-coin-eth/test/unit/register.ts🤖 Generated with Claude Code